<template>
  <template
    v-for="(item, index) in items_"
    :key="item.id ?? items_.name ?? index"
  >
    <slot
      :item="item"
      :index="index"
      :update="update"
      :value="getValue(item)"
    ></slot>
  </template>
</template>
<script lang="ts" setup generic="T extends Aoe">
import type { Aoe } from 'aoe';
import type { GroupProps } from './useGroup';
import { useGroup } from './useGroup';

const props = defineProps<GroupProps<T>>();
const modelValue = defineModel<unknown>();

const { items_, update, getValue } = useGroup<T>(modelValue, props);

defineOptions({
  inheritAttrs: false,
});
</script>
<style scoped></style>
